<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="shortcut icon" href="<!--{eval echo register_static('img/touch-icon-57x57.png');}-->">

    <title>粉粉管理系统</title>

    <!-- Bootstrap core CSS -->
    <link href="<!--{eval echo register_static('css/bootstrap.min.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('css/bootstrap-reset.css');}-->" rel="stylesheet">

    <!--Animation css-->
    <link href="<!--{eval echo register_static('css/animate.css');}-->" rel="stylesheet">

    <!--Icon-fonts css-->
    <link href="<!--{eval echo register_static('assets/font-awesome/css/font-awesome.css');}-->" rel="stylesheet" />
    <link href="<!--{eval echo register_static('assets/ionicon/css/ionicons.min.css');}-->" rel="stylesheet" />

    <link href="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.css');}-->" rel="stylesheet">

    <!-- Plugins css -->
    <link href="<!--{eval echo register_static('assets/modal-effect/css/component.css');}-->" rel="stylesheet">

    <!-- DataTables -->
    <link rel="stylesheet" href="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.css" rel="stylesheet');}-->" />

    <!-- Custom styles for this template -->
    <link href="<!--{eval echo register_static('css/style.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('css/helper.css');}-->" rel="stylesheet">

    <!-- My styles for this template -->
    <link href="<!--{eval echo register_static('css/common.css');}-->" rel="stylesheet">

</head>

<body>

<!-- Aside Start-->
<!--{template admin_v2/leftside}-->
<!-- Aside Ends-->


<!--Main Content Start -->
<section class="content">

    <!-- Header -->
    <!--{template admin_v2/header}-->
    <!-- Header Ends -->


    <!-- Page Content Start -->
    <!-- ================== -->

    <div class="wraper container-fluid diary-topics">

        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">话题详情及评论</h3>
                    </div>
                    <div class="panel-body">

                    <div class="row" id="tbody_userStatistics">
                    </div>
                        <div class="row">
                            <div class="col-md-12 col-sm-12 col-xs-12">
                                <table width="100%" class="table table-striped table-bordered">
                                    <thead>
                                    <tr>
                                        <th>作者</th>
                                        <th>标题</th>
                                        <th>圈子</th>
                                        <th>内容</th>
                                        <th>发布时间</th>
                                        <th>回复数</th>
                                    </tr>
                                    </thead>
                                    <tbody id="tbody_user">

                                    </tbody>
                                </table>
                            </div>
                        </div>

                        <div class="row" style="margin-bottom: 10px;margin-top: 10px">
                            <div class="col-md-5 col-sm-5 col-xs-5">
                                <!-- Search -->
                                <form method="get" action="admin.php" class="form-inline" role="form" >
                                    排序选择:
                                    <select name="order"  class="form-control" >
                                        <option value="favorites">点赞数</option>
                                        <option value="time">发布时间</option>
                                    </select>
                                    <select name="sort" class="form-control" >
                                        <option value="desc">降序</option>
                                        <option value="acs">升序</option>
                                    </select>
                                    <input type="hidden" value="diarytopic_class" name="ac">
                                    <input type="hidden" value="getTopicInfo" name="op">
                                    <input type="hidden" value="{$_GET[tid]}" name="tid">
                                    <input type="hidden" value="{$_GET[uid]}" name="uid">
                                    <input type="submit" value="查询" class="btn btn-success m-l-10" />
                                </form>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12 col-sm-12 col-xs-12">
                                <table width="100%" class="table table-striped table-bordered">
                                    <thead>
                                    <tr>
                                        <th>楼层</th>
                                        <th>评论人</th>
                                        <th>评论内容</th>
                                        <th>点赞数</th>
                                        <th>发布时间</th>
                                        <th>引用</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <!--{loop $list['comments'] $value}-->
                                    <tr>
                                        <td>{$value[position]} 楼</td>
                                        <td><a target="_blank" href="admin.php?ac=admin&do=accountOperation&uid={$value[uid]}">{$value[nickname]}</a></td>
                                        <td>{$value[content]}</td>
                                        <td>{$value[favorites]}</td>
                                        <td><!--{date('Y-m-d H:i:s',$value[time])}--></td>
                                        <td>无引用</td>
                                        <td>无操作</td>
                                    </tr>
                                    <!--{/loop}-->
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <!--{if $pageUrl}-->
                        <ul class="pager">
                            <li>
                                <a href="{$pageUrl['prev']}"> <i class="fa fa-angle-double-left"></i>上一页</a>
                            </li>
                            <li>
                                <a href="{$pageUrl['first']}"> <i class="fa"></i>第一页</a>
                            </li><li>
                            <a href="javascript:;"> <i class="fa"></i>当前为{$pageUrl['currentPage']}页，共{$pageUrl['totalPage']}页</a>
                        </li>
                            <li>
                                <a href="{$pageUrl['next']}">下一页 <i class="fa fa-angle-double-right"></i> </a>
                            </li>
                        </ul>
                        <!--{/if}-->
                    </div>
                </div>
            </div>
        </div>

    </div>
    <!-- Page Content Ends -->
    <!-- ================== -->

    <div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">

    </div><!-- /.modal -->


    <!-- Footer Start -->
    <!--{template admin_v2/footer}-->
    <!-- Footer Ends -->



</section>
<!-- Main Content Ends -->


<!-- js placed at the end of the document so the pages load faster -->
<script src="<!--{eval echo register_static('js/jquery.js');}-->"></script>
<script src="<!--{eval echo register_static('js/bootstrap.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/pace.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/wow.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/jquery.nicescroll.js');}-->" type="text/javascript"></script>

<script src="<!--{eval echo register_static('js/jquery.app.js');}-->"></script>

<script src="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.js');}-->"></script>
<script src="<!--{eval echo register_static('assets/datatables/dataTables.bootstrap.js');}-->"></script>
<script src="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.js');}-->"></script>
<script src="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.init.js');}-->"></script>

<!-- Modal-Effect -->
<script src="<!--{eval echo register_static('assets/modal-effect/js/classie.js');}-->"></script>
<script src="<!--{eval echo register_static('assets/modal-effect/js/modalEffects.js');}-->"></script>

<script type="text/javascript">
    $(document).ready(function() {
        var tid=GetQueryString('tid');
        $.ajax({
            dataType : 'json',
            url  : '/admin.php?ac=diarytopic_class&op=getParam',
            type : 'POST',
            data : 'tid='+tid,
            success: function(returnData){
                if(returnData){
                    strHtml(returnData);
                }
            }
        });
    });

    function strHtml(r){
        var times = parseInt(r.time)*1000;
        var newTime =  new Date(parseInt(times)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
        var str = '<tr><td>';
        str +='<img data-src="'+r.user.avatar+'" alt="20x20" style="width: 20px; height: 20px;" src="'+r.user.avatar+'">'+
            '<a href="admin.php?ac=admin&do=accountOperation&uid='+r.user.uid+'">'+r.user.nickname+'</a></td>';
        str +='<td>'+r.title+'</td>';
        str +='<td>'+r.gname+'</td>';
        str +='<td>'+r.content+'</td>';
        str +='<td>'+newTime+'</td>';
        str +='<td>'+r.res_num+'</td>';
        $('#tbody_user').html(str);
        $('.res_num').val(r.res_num);
    }

    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }

</script>
</body>
</html>
